//
//  OPHDownloadRequestExecute.h
//  AtWork2
//
//  Created by lingen on 4/25/16.
//  Copyright © 2016 Foreverht. All rights reserved.
//

#import <Foundation/Foundation.h>

@class OPHDownloadRequest;

/**
 *  处理下载请求
 */
@interface OPHDownloadRequestExecute : NSObject


/**
 *  下载请求
 */
@property (nonatomic,strong) OPHDownloadRequest* downloadRequest;


/**
 *  progress回调
 */
@property (nonatomic,copy) void(^progressBlock)(float progress);

/**
 *  完成回调
 */
@property (nonatomic,copy) void(^completeBlock)(NSString* filePath);


/**
 *  开始下载
 *
 *  @return 返回一个下载任务
 */
-(NSURLSessionDownloadTask*)startDownload;


/**
 *  中止一个下载行为
 *
 *  @return 返回中止是否成功
 */
-(BOOL)cancelDownload;

/*
 * 中断一个下载
 */
-(BOOL)pauseDownload;

/*
 * 恢复一个下载
 */
-(BOOL)resumeDownload;
@end
